#include "CGravityForceGenerator.h"

using namespace ParticleMotion;
using namespace Core;

CGravityForceGenerator::CGravityForceGenerator(Vector3 gravity)
{
	this->gravity=gravity;
}

void CGravityForceGenerator::update(CEntity * entity, real deltaT)
{
	if(!entity->hasFiniteMass()) return;

	entity->addForce(gravity*entity->getMass());
}